IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'SectionInsert')
	BEGIN
		DROP  Procedure  SectionInsert
	END

GO

CREATE Procedure SectionInsert
@ChapterID Int,
@ImagePath Int,
@Body Ntext,
@AccessID Int,
@CreatorID Int
AS
Insert Into ChapterSection
(
	ChapterID,
	ImagePath,
	Body,
	AccessID,
	ViewOrder,
	CreatorID,
	CreatedDate
)
Values
(
	@ChapterID,
	@ImagePath,
	@Body,
	@AccessID,
	SectionGetViewOrdinal(@ChapterID),
	@CreatorID,
	GetDate()
	
)
Return SCOPE_IDENTITY()
GO


